Title: SQL W3S (By-BKK) / 026 Inner Join
Tags: Obsidian_to_Anki

Q: What does the SQL INNER JOIN keyword do?
A: It selects records that have matching values in both tables

Q: True or False: INNER JOIN returns only rows with a match in both tables
A: True

Q: How do you join the Products and Categories tables by CategoryID?
A: By using INNER JOIN on Products.CategoryID = Categories.CategoryID

Q: What is the SQL syntax for INNER JOIN?
A: SELECT column_name(s) FROM table1 INNER JOIN table2 ON table1.column_name = table2.column_name

Q: Why should you include the table name when specifying columns in an SQL JOIN?
A: To avoid errors when columns have the same name in both tables

Q: True or False: SQL JOIN and INNER JOIN produce different results
A: False

Q: What is the default join type for the JOIN keyword in SQL?
A: INNER JOIN

Q: Which keyword is the default for JOIN: INNER, LEFT, or RIGHT?
A: INNER

Q: What happens if a Product has a CategoryID not present in Categories table when using INNER JOIN?
A: It will not be returned in the result

Q: Show an example of joining Products with Categories using table names
A: SELECT Products.ProductID, Products.ProductName, Categories.CategoryName FROM Products INNER JOIN Categories ON Products.CategoryID = Categories.CategoryID

Q: Reverse: SELECT Orders.OrderID, Customers.CustomerName, Shippers.ShipperName FROM ((Orders INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID) INNER JOIN Shippers ON Orders.ShipperID = Shippers.ShipperID);
A: What is an example of joining three tables in SQL using INNER JOIN?

Q: Reverse: It selects records that have matching values in both tables
A: What does the SQL INNER JOIN keyword do?

Q: Reverse: True
A: INNER JOIN returns only rows with a match in both tables — True or False?